﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ReplaceFileVersion
{
    public partial class DirHistoryForm : Form
    {
        public delegate void HistorySelectItemEventHandler(string dir);
        public DirHistoryForm()
        {
            InitializeComponent();
            listBoxHistory.DataSource = ReplaceFileVersion.GetDirHistory();
        }

        public event HistorySelectItemEventHandler SelectItemEventHandler;

        private void listBoxHistory_SelectedValueChanged(object sender, EventArgs e)
        {
            var selectItem = listBoxHistory.SelectedItem;
            if (selectItem == null)
            {
                return;
            }
            var dir = selectItem.ToString();
            SelectItemEventHandler(dir);
        }


        private void DirHistoryForm_Deactivate(object sender, EventArgs e)
        {
           // MessageBox.Show("22");
            this.Close();
        }
    }
}
